<?php
/**
 * 用户历史信息相关的函数
 */

require_once '../dr-config.php';
require_once ABSPATH . DRINC . '/dr-functions.php';

/**
 * 获得用户的历史行为统计信息
 *
 * @param unknown_type $userid
 */
function dr_get_user_histories_stats_with_userid($user_id)
{
	$posts = array(
		'action' => 'get_user_histories_stats',
		'user_id' => $user_id
	);
	$json_histories = dr_server_request('dr-app-histories.php', $posts);
	return json_decode($json_histories, true);
}

//echo '<pre>';
//print_r(dr_get_user_histories_stats_with_userid(1));
/**
 * 获得所有用户的历史行为的统计信息
 */
function dr_get_all_user_histories_stats()
{
	$posts = array(
		'action' => 'get_all_histories_stats'
	);
	$json_histories = dr_server_request('dr-app-histories.php', $posts);
	return json_decode($json_histories, true);
}
//echo '<pre>';
//print_r (dr_get_all_user_histories_stats());